<?php
if (isset($_REQUEST['maFonction']) && $_REQUEST['maFonction'] != '')
{
    $_REQUEST['maFonction']();
}

function startSession() {
	session_start();
	if(!isset($_SESSION['user'])) {
//		if($_SESSION['user']=='') {
			trigger_error("You are not signed in, please connect to the SCC portal.",E_USER_ERROR);
//		} else echo $_SESSION['user'];
	} else echo $_SESSION['droits'];
}

function stopSession() {
	session_start();
	$_SESSION = array();
	session_destroy();
	//unset($_SESSION['user']);
/*
	if (isset($_SERVER['HTTP_COOKIE'])) {
		$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
		foreach($cookies as $cookie) {
			$parts = explode('=', $cookie);
			$name = trim($parts[0]);
			setcookie($name, '', time()-1000);
			setcookie($name, '', time()-1000, '/');
		}
	}
	exit;*/
}
?>